package design.factory.factoryMethod;

public class Test {
    public static void main(String[] args) {
        System.out.println("开局一把手枪");
        Gun gun = GunFactory.getDefaultGun();
        System.out.println("开枪");
        gun.shoot();
        System.out.println("-------------");
        Gun handGun = HandGunFactory.getFactory().getGun();
        System.out.println("第二把手枪");
        handGun.shoot();
        System.out.println("-------------");
        Gun mechineGun = MachineGunFactory.getFactory().getGun();
        System.out.println("来来来，换机枪");
        mechineGun.shoot();
    }
}
